import pandas as pd
class BankSys:
    user_infos=None
    # 初始化用户数据
    def init(self):
        self.user_infos = pd.read_table('data/银行用户信息.txt', header=None, sep=',', encoding='utf-8')
        keyList = list(range(9))
        headlist = ['编号', '姓名', '性别', '身高', '出生日期', '户籍', '开户地区', '开卡时间', '余额']
        headDict = dict(zip(keyList, headlist))  # 将两个列表组合成字典
        # 换头
        self.user_infos.reset_index()
        self.user_infos.rename(columns=headDict, inplace=True)
        print(self.user_infos)
    #增加用户
    def addUser(self):
        pass
    #删除用户
    def delUserByName(self,name):
        self.user_infos = self.user_infos.loc[self.user_infos['姓名']!=name,]
        print(self.user_infos)
    def delUserByCost(self,cost):
        self.user_infos = self.user_infos.loc[self.user_infos['余额']>cost,]
        print(self.user_infos)
    #查找用户
    def searchUser(self):
        pass
bankSys=BankSys()
bankSys.init()
bankSys.delUserByCost(7000)
#bankSys.delUserByName('李四')